package com.wuwei.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;

/**
 * @description: ReceiveMsgService <br>
 * @date: 2021/2/17 21:54 <br>
 * @author: wuwei666 <br>
 * @version: 1.0 <br>
 */
@EnableBinding(Sink.class)
public class ReceiveMsgService {

    @Value("${server.port}")
    private String port;

    @StreamListener(Sink.INPUT)
    public void input(Message<String> msg){
        System.out.println("消费者>>>>>>" + msg.getPayload() + "端口号" + port);
    }
}
